package org.realteam.base.service;

import org.realteam.base.dao.BaseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;

/**
 * @author Harry
 * @version 1.0 Created On：2011-12-17 下午8:20:23
 * 
 */

@Service
@Transactional
public class BaseManagerImpl implements BaseManager {

	@Autowired
	@Qualifier("baseTransactionTemplate")
	TransactionTemplate transactionTemplate;

	@Autowired
	BaseDao dao;

	public void saveObject(Object object) {

//		transactionTemplate.execute(new TransactionCallbackWithoutResult() {
//
//			protected void doInTransactionWithoutResult(TransactionStatus status) {
//				TestBean t = new TestBean();
//				t.setName("Lily");
//			}
//		});

		dao.save(object);

	}

	public void updateObject(Object object) {
		dao.saveOrUpdate(object);

	}

	public void deleteObject(Object object) {
		dao.delete(object);

	}
	
	

}
